<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkComboBoxEntry</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
<link rel="up" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="prev" href="GtkComboBoxText.html" title="GtkComboBoxText">
<link rel="next" href="GtkMenu.html" title="GtkMenu">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkComboBoxText.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
<td><a accesskey="n" href="GtkMenu.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GtkComboBoxEntry.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GtkComboBoxEntry.description" class="shortcut">Description</a>
                   | 
                  <a href="#GtkComboBoxEntry.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#GtkComboBoxEntry.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#GtkComboBoxEntry.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="GtkComboBoxEntry"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkComboBoxEntry.top_of_page"></a>GtkComboBoxEntry</span></h2>
<p>GtkComboBoxEntry — A text entry field with a dropdown list</p>
</td>
<td valign="top" align="right"><img src="combo-box-entry.png"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GtkComboBoxEntry.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="GtkComboBoxEntry.html#GtkComboBoxEntry-struct" title="struct GtkComboBoxEntry">GtkComboBoxEntry</a>;
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new" title="gtk_combo_box_entry_new ()">gtk_combo_box_entry_new</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new-with-model" title="gtk_combo_box_entry_new_with_model ()">gtk_combo_box_entry_new_with_model</a>  (<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *model</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_column</code></em>);
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new-text" title="gtk_combo_box_entry_new_text ()">gtk_combo_box_entry_new_text</a>        (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-set-text-column" title="gtk_combo_box_entry_set_text_column ()">gtk_combo_box_entry_set_text_column</a> (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_column</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-get-text-column" title="gtk_combo_box_entry_get_text_column ()">gtk_combo_box_entry_get_text_column</a> (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
         +----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
               +----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
                     +----<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
                           +----<a class="link" href="GtkBin.html" title="GtkBin">GtkBin</a>
                                 +----<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a>
                                       +----GtkComboBoxEntry
</pre>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkComboBoxEntry implements
 AtkImplementorIface,  <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>,  <a class="link" href="GtkCellLayout.html" title="GtkCellLayout">GtkCellLayout</a> and  <a class="link" href="GtkCellEditable.html" title="GtkCellEditable">GtkCellEditable</a>.</p>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="GtkComboBoxEntry.html#GtkComboBoxEntry--text-column" title='The "text-column" property'>text-column</a>"              <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a>                  : Read / Write
</pre>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.description"></a><h2>Description</h2>
<p>
A <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> is a widget that allows the user to choose from a
list of valid choices or enter a different value. It is very similar
to a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>, but it displays the selected value in an entry to
allow modifying it.
</p>
<p>
In contrast to a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>, the underlying model of a <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>
must always have a text column (see <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-set-text-column" title="gtk_combo_box_entry_set_text_column ()"><code class="function">gtk_combo_box_entry_set_text_column()</code></a>),
and the entry will show the content of the text column in the selected row.
To get the text from the entry, use <a class="link" href="GtkComboBox.html#gtk-combo-box-get-active-text" title="gtk_combo_box_get_active_text ()"><code class="function">gtk_combo_box_get_active_text()</code></a>.
</p>
<p>
The changed signal will be emitted while typing into a GtkComboBoxEntry,
as well as when selecting an item from the GtkComboBoxEntry's list. Use
<a class="link" href="GtkComboBox.html#gtk-combo-box-get-active" title="gtk_combo_box_get_active ()"><code class="function">gtk_combo_box_get_active()</code></a> or <a class="link" href="GtkComboBox.html#gtk-combo-box-get-active-iter" title="gtk_combo_box_get_active_iter ()"><code class="function">gtk_combo_box_get_active_iter()</code></a> to discover
whether an item was actually selected from the list.
</p>
<p>
Connect to the activate signal of the GtkEntry (use <a class="link" href="GtkBin.html#gtk-bin-get-child" title="gtk_bin_get_child ()"><code class="function">gtk_bin_get_child()</code></a>)
to detect when the user actually finishes entering text.
</p>
<p>
The convenience API to construct simple text-only <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>es
can also be used with <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>s which have been constructed
with <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new-text" title="gtk_combo_box_entry_new_text ()"><code class="function">gtk_combo_box_entry_new_text()</code></a>.
</p>
<p>
If you have special needs that go beyond a simple entry (e.g. input validation),
it is possible to replace the child entry by a different widget using
<a class="link" href="GtkContainer.html#gtk-container-remove" title="gtk_container_remove ()"><code class="function">gtk_container_remove()</code></a> and <a class="link" href="GtkContainer.html#gtk-container-add" title="gtk_container_add ()"><code class="function">gtk_container_add()</code></a>.
</p>
<div class="refsect2">
<a name="GtkComboBoxEntry-BUILDER-UI"></a><h3>GtkComboBoxEntry as GtkBuildable</h3>
<p>
Beyond the &lt;attributes&gt; support that is shared by all
<a class="link" href="GtkCellLayout.html#GtkCellLayout-BUILDER-UI" title="GtkCellLayouts as GtkBuildable">GtkCellLayout</a> implementation,
GtkComboBoxEntry makes the entry available in UI definitions as an internal
child with name "entry".
</p>
</div>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkComboBoxEntry-struct"></a><h3>struct GtkComboBoxEntry</h3>
<pre class="programlisting">struct GtkComboBoxEntry;</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GtkComboBoxEntry</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-entry-new"></a><h3>gtk_combo_box_entry_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_combo_box_entry_new             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_combo_box_entry_new</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-new-with-entry" title="gtk_combo_box_new_with_entry ()"><code class="function">gtk_combo_box_new_with_entry()</code></a> instead</p>
</div>
<p>
Creates a new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> which has a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a> as child. After
construction, you should set a model using <a class="link" href="GtkComboBox.html#gtk-combo-box-set-model" title="gtk_combo_box_set_model ()"><code class="function">gtk_combo_box_set_model()</code></a> and a
text column using <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-set-text-column" title="gtk_combo_box_entry_set_text_column ()"><code class="function">gtk_combo_box_entry_set_text_column()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-entry-new-with-model"></a><h3>gtk_combo_box_entry_new_with_model ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_combo_box_entry_new_with_model  (<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *model</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_column</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_combo_box_entry_new_with_model</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-new-with-model-and-entry" title="gtk_combo_box_new_with_model_and_entry ()"><code class="function">gtk_combo_box_new_with_model_and_entry()</code></a> instead</p>
</div>
<p>
Creates a new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> which has a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a> as child and a list
of strings as popup. You can get the <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a> from a <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>
using GTK_ENTRY (GTK_BIN (combo_box_entry)-&gt;child). To add and remove
strings from the list, just modify <em class="parameter"><code>model</code></em> using its data manipulation
API.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>model</code></em> :</span></p></td>
<td>A <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text_column</code></em> :</span></p></td>
<td>A column in <em class="parameter"><code>model</code></em> to get the strings from.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-entry-new-text"></a><h3>gtk_combo_box_entry_new_text ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_combo_box_entry_new_text        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_combo_box_entry_new_text</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Convenience function which constructs a new editable text combo box, which 
is a <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> just displaying strings. If you use this function to
create a text combo box, you should only manipulate its data source with
the following convenience functions: <a class="link" href="GtkComboBox.html#gtk-combo-box-append-text" title="gtk_combo_box_append_text ()"><code class="function">gtk_combo_box_append_text()</code></a>,
<a class="link" href="GtkComboBox.html#gtk-combo-box-insert-text" title="gtk_combo_box_insert_text ()"><code class="function">gtk_combo_box_insert_text()</code></a>, <a class="link" href="GtkComboBox.html#gtk-combo-box-prepend-text" title="gtk_combo_box_prepend_text ()"><code class="function">gtk_combo_box_prepend_text()</code></a> and
<a class="link" href="GtkComboBox.html#gtk-combo-box-remove-text" title="gtk_combo_box_remove_text ()"><code class="function">gtk_combo_box_remove_text()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A new text <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-entry-set-text-column"></a><h3>gtk_combo_box_entry_set_text_column ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_combo_box_entry_set_text_column (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_column</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_combo_box_entry_set_text_column</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-set-entry-text-column" title="gtk_combo_box_set_entry_text_column ()"><code class="function">gtk_combo_box_set_entry_text_column()</code></a> instead</p>
</div>
<p>
Sets the model column which <em class="parameter"><code>entry_box</code></em> should use to get strings from
to be <em class="parameter"><code>text_column</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>entry_box</code></em> :</span></p></td>
<td>A <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>text_column</code></em> :</span></p></td>
<td>A column in <em class="parameter"><code>model</code></em> to get the strings from.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-entry-get-text-column"></a><h3>gtk_combo_box_entry_get_text_column ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gtk_combo_box_entry_get_text_column (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_combo_box_entry_get_text_column</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-get-entry-text-column" title="gtk_combo_box_get_entry_text_column ()"><code class="function">gtk_combo_box_get_entry_text_column()</code></a> instead</p>
</div>
<p>
Returns the column which <em class="parameter"><code>entry_box</code></em> is using to get the strings from.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>entry_box</code></em> :</span></p></td>
<td>A <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A column in the data source model of <em class="parameter"><code>entry_box</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkComboBoxEntry--text-column"></a><h3>The <code class="literal">"text-column"</code> property</h3>
<pre class="programlisting">  "text-column"              <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a>                  : Read / Write</pre>
<p>A column in the data source model to get the strings from.</p>
<p>Allowed values: &gt;= G_MAXULONG</p>
<p>Default value: -1</p>
</div>
</div>
<div class="refsect1">
<a name="GtkComboBoxEntry.see-also"></a><h2>See Also</h2>
<p>
<a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>